package com.desmart.ht;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.desmart.ht.utils.ToastUtils;

public class NewScheduleActivity extends BaseActivity implements View.OnClickListener {

    private TextView tvCancel;
    private TextView tvSumbit;
    private TextView tvTypeContent;
    private TextView tvCategoryContent;
    private View tvStartTimeContent;
    private TextView tvEndTimeContent;

    public static void start(Context context){
        context.startActivity(new Intent(context,NewScheduleActivity.class));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_schedule);
        initTitle();
        initViews();
    }

    private void initViews() {
        //类型
        View typeView = findViewById(R.id.view_type);
        TextView tvTypeTitle = typeView.findViewById(R.id.tv_item_title);
        tvTypeContent = typeView.findViewById(R.id.tv_item_content);
        tvTypeContent.setOnClickListener(this);
        tvTypeTitle.setText("类型");

        //类别
        View categoryView = findViewById(R.id.view_category);
        TextView tvCategoryTitle = categoryView.findViewById(R.id.tv_item_title);
        tvCategoryContent = categoryView.findViewById(R.id.tv_item_content);
        tvCategoryContent.setOnClickListener(this);
        tvCategoryTitle.setText("类别");

        //标题
        View InputTitleView = findViewById(R.id.view_input_title);
        EditText etTitle = InputTitleView.findViewById(R.id.et_item_input);
        etTitle.setHint("请输入标题");

        //描述
        View InputDescribeView = findViewById(R.id.view_input_describe);
        EditText etDescribe = InputDescribeView.findViewById(R.id.et_item_input);
        etDescribe.setHint("请输入描述");

        //开始时间
        View startTimeView = findViewById(R.id.view_start_time);
        TextView tvStartTimeTitle = startTimeView.findViewById(R.id.tv_item_title);
        tvStartTimeContent = startTimeView.findViewById(R.id.tv_item_content);
        tvStartTimeContent.setOnClickListener(this);
        tvStartTimeTitle.setText("开始时间");

        //结束时间
        View endTimeView = findViewById(R.id.view_end_time);
        TextView tvEndTimeTitle = endTimeView.findViewById(R.id.tv_item_title);
        tvEndTimeContent = endTimeView.findViewById(R.id.tv_item_content);
        tvEndTimeContent.setOnClickListener(this);
        tvEndTimeTitle.setText("结束时间");

        //接收人
        View receiveView = findViewById(R.id.view_receive);
        TextView tvReceiveTitle = receiveView.findViewById(R.id.tv_item_title);
        tvReceiveTitle.setText("接收人");

        //提醒
        View remindView = findViewById(R.id.view_remind);
        TextView tvRemindTitle = remindView.findViewById(R.id.tv_item_title);
        tvRemindTitle.setText("提醒");

        //附件上传
        View attachmentView = findViewById(R.id.view_attachment);
        TextView tvAttachmentTitle = attachmentView.findViewById(R.id.tv_item_title);
        tvAttachmentTitle.setText("附件上传");

        //请输入地址
        View addressView = findViewById(R.id.view_address);
        EditText edAddress = addressView.findViewById(R.id.et_item_input);
        edAddress.setHint("请输入地址");

    }

    private void initTitle() {
        tvCancel = findViewById(R.id.tv_title_left);
        tvSumbit = findViewById(R.id.tv_title_right);
        TextView tvTitle = findViewById(R.id.tv_title);
        tvCancel.setOnClickListener(this);
        tvSumbit.setOnClickListener(this);
        tvTitle.setText("新建日程");
    }

    @Override
    public void onClick(View view) {
        if (view == tvCancel){
            onBackPressed();
        }else if (view == tvSumbit){
            ToastUtils.show("确定");
        }else if (view == tvTypeContent){
            showType();
        }else if (view == tvCategoryContent){
            ToastUtils.show("类别");
        }
    }

    private void showType() {

    }
}
